package pl.org.lutra.planner.gui.table;

import pl.org.lutra.planner.gui.table.DecoTableModel.DecoColumn;
import pl.org.lutra.planner.gui.util.DepthFormat;
import pl.org.lutra.planner.gui.util.TimeFormat;
import pl.org.lutra.planner.model.data.DecoSegment;

public class DecoTable extends PlannerTable<DecoSegment> {
	private static final long serialVersionUID = -8983464277458030357L;

	public DecoTable() {
		super(new DecoTableModel());

		setRowSelectionAllowed(false);

		initColumnsBehavior();
	}

	private void initColumnsBehavior() {
		PaddingTableCellRenderer depthRenderer = new PaddingTableCellRenderer(new DepthFormat());
		setColumnBehavior(DecoColumn.DEPTH, depthRenderer, null);

		PaddingTableCellRenderer timeRenderer = new PaddingTableCellRenderer(new TimeFormat());
		setColumnBehavior(DecoColumn.TIME, timeRenderer, null);
	}

	@Override
	public DecoTableModel getModel() {
		return (DecoTableModel) super.getModel();
	}
}
